<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<title>商品列表-用户中心</title>
<style>
	#color{
		color:blue;
	}
</style>
<meta name="keywords"  content="DeathGhost" />
<meta name="description" content="DeathGhost" />
<meta name="author" content="DeathGhost,deathghost@deathghost.cn">
<link rel="icon" href="images/icon/favicon.ico" type="image/x-icon">
<link rel="stylesheet" type="text/css" href="css/style.css" /><script src="js/html5.js"></script>
<script src="js/jquery.js"></script>
<script>
$(document).ready(function(){
  $("nav .indexAsideNav").hide();
  $("nav .category").mouseover(function(){
	  $(".asideNav").slideDown();
	  });
  $("nav .asideNav").mouseleave(function(){
	  $(".asideNav").slideUp();
	  });
});
</script>
<script>
 $(document).ready(function(){
   //测试效果，程序对接如需变动重新编辑
   $(".switchNav li").click(function(){
     $(this).addClass("active").siblings().removeClass("active");
     });
   $("#chanpin").click(function(){
     $(".inputWrap input[type='text']").attr("placeholder","输入产品关键词或货号");
     });
   $("#shangjia").click(function(){
     $(".inputWrap input[type='text']").attr("placeholder","输入商家店铺名");
     });
   $("#zixun").click(function(){
     $(".inputWrap input[type='text']").attr("placeholder","输入关键词查找文章内容");
     });
   $("#wenku").click(function(){
     $(".inputWrap input[type='text']").attr("placeholder","输入关键词查找文库内容");
     });
   });
   
 </script>
</head>
<body>
<div id="app">
<!--header-->
<header>
  <!--topNavBg-->
  <div class="topNavBg">
   <div class="wrap">
   <!--topLeftNav-->
    <ul class="topLtNav">
     <span  >
     <li>尊敬的用户:  您好!</li>
     <li><a href="login.html?sellect_product_list.html">退出登录</a></li> 
     </span>
    <span >
     <li><a href="login.html" class="obviousText">亲，请登录</a></li>
     <li><a href="register.html">注册</a></li>
     </span>
    </ul>
   <!--topRightNav-->
    <ul class="topRtNav">
     <li><a href="user.html">个人中心</a></li>
     <li><a href="javascript:void(0)" class="cartIcon">购物车<i></i></a></li>
     <li><a href="javascript:void(0)" class="favorIcon">收藏夹</a></li>
     <li><a href="user.html">商家中心</a></li>
     <li><a href="article_read.html" class="srvIcon">客户服务</a></li>
     <li><a href="union_login.html">联盟管理</a></li>
    </ul>
   </div>
  </div>
  <!--logoArea-->
  <div class="wrap logoSearch">
   <!--logo-->
   <div class="logo">
    <h1><img src="images/idid_ifrtgzddgm3dmnjshezdambqhayde_49x48.png" style="witch:100px"/></h1>
   </div>
   <!--search-->
   <div class="search">
    <ul class="switchNav">
     <li class="active" id="chanpin">产品</li>
     <li id="shangjia">商家</li>
     <li id="zixun">搭配</li>
     <li id="wenku">文库</li>
    </ul>
    <div class="searchBox">
     <form>
      <div class="inputWrap">
      <input type="text" placeholder="输入产品关键词或货号"/>
      </div>
      <div class="btnWrap">
      <input type="submit" value="搜索"/>
      </div>
     </form>
     <a href="#" class="advancedSearch">高级搜索</a>
    </div>
   </div>
  </div>
  <!--nav-->
  <nav>
<ul class="wrap navList">
<li class="category">
<a>全部产品分类</a>
</li>
<li>
<a href="index.html" class="active">首页</a>
</li>
<li>
<a href="#">时尚搭配</a>
</li>
<li>
<a href="channel.html">原创设计</a>
</li>
<li>
<a href="channel.html">时尚代购</a>
</li>
<li>
<a href="channel.html">民族风</a>
</li>
<li>
<a href="information.html">时尚搭配</a>
</li>
<li>
<a href="library.html">搭配知识</a>
</li>
<li>
<a href="#">促销专区</a>
</li>
<li>
<a href="#">其他</a>
</li>
</ul>
</nav>

 </header>
 
 
<section class="wrap user_center_wrap">
 <!--左侧导航-->
  <aside class="user_aside_nav">
  <!-- <dl>
   <dt>买家中心</dt>
   <dd><a href="order_list.html">我的订单</a></dd>
   <dd><a href="price_list.html">我的询价单</a></dd>
   <dd><a href="favorite.html">我的收藏</a></dd>
   <dd><a href="address.html">我的地址库</a></dd>
  </dl> -->
  <dl>
   <dt>商家管理中心</dt>
   <dd><a href="/user/authenticate.html">我要开店</a></dd>
   <dd><a href="/user/setting.html">店铺设置</a></dd>
   <dd><a href="/product/seller_product_list.html">商品列表</a></dd>
   <dd><a href="/order/seller_order_list.html">订单列表</a></dd>
   <dd><a href="javascript:void(0)">用户咨询信息</a></dd>
  </dl>
  <!-- <dl>
   <dt>控制面板</dt>
   <dd><a href="message.html">站内短消息</a></dd>
   <dd><a href="account.html">资金管理</a></dd>
   <dd><a href="profile.html">个人资料</a></dd>
   <dd><a href="change_password.html">修改密码</a></dd>
  </dl> -->
 </aside>
 <!--右侧：内容区域-->
 <div class="user_rt_cont">
  <div class="top_title">
   <strong>商品列表</strong>
   <a href="seller_product_detail.html" title="添加新商品" class="fr">添加新商品</a>
  </div>
  <!--条件检索-->
  <div style="margin:8px 0;">
   <!-- <select class="select">
    <option>商品分类</option>
    <option>男装</option>
    <option>女装</option>
    <option>配饰</option>
   </select> -->
   <input type="text" class="textbox textbox_225" placeholder="输入产品货号/关键词" />
   <input type="button" value="搜索" class="group_btn" />
  </div>
  <table class="order_table">
   <tr>
    <th>货号</th>
    <th>图片</th>
    <th>名称</th>
    <th>价格</th>
    <th>库存</th>
    <th>尺寸和颜色</th>
    <th>操作</th>
   </tr>
   <tr v-for="item,index in product" >
    <td class="center">A{{item.pid}}</td>
    <td class="center"><a :href=`/product/product.html?${item.pid}` target="_blank"><img :src=`${item.pics}` width="50" height="50"/></a></td>
    <td><a h :href=`/product/product.html?${item.pid}` target="_blank">{{item.type + item.model + item.pname}}</a></td>
    <td class="center"><strong class="rmb_icon">{{item.price}}</strong></td>
    <td class="center">{{item.bnum}}</td>
    <td class="center">{{item.bsize}}/{{item.bcolor}}</td>
    <td class="center">
     <a :href=`/product/shopdetail.html?${item.pid}` target="_blank" title="查看"><img src="images/icon_view.gif"/></a>
     <a href="javascript:void(0)" onclick ="opentext()" title="编辑"><img src="images/icon_edit.gif"/></a><!-- :href=`seller_product_detail2.html?${item.pid}` -->
     <a title="删除"  ><img src="images/icon_trash.gif"/></a>
    </td>
   </tr>
   
  </table>
   <!--分页-->
   <div class="paging" style="text-align:right">
    <a @click ="gotoPageNum(1)" >第一页</a>
    <a class="active"  @click ="gotoPageNum(1)" id ="color">1</a>
    <a class="active" v-for="item in totalPage" @click ="gotoPageNum(item+1)" >{{item+1}}</a>
    <a @click ="gotoPageNum(totalPage+1)" >最后一页</a>
   </div>  
 </div>
</section>
<!--footer-->
<footer>
 <!--help-->
 <ul class="wrap help">
  <li>
   <dl>
    <dt>消费者保障</dt>
    <dd><a href="article_read.html">保障范围</a></dd>
    <dd><a href="article_read.html">退换货流程</a></dd>
    <dd><a href="article_read.html">服务中心</a></dd>
    <dd><a href="article_read.html">更多服务特色</a></dd>
   </dl>
  </li>
  <li>
   <dl>
    <dt>新手上路</dt>
    <dd><a href="article_read.html">保障范围</a></dd>
    <dd><a href="article_read.html">退换货流程</a></dd>
    <dd><a href="article_read.html">服务中心</a></dd>
    <dd><a href="article_read.html">更多服务特色</a></dd>
   </dl>
  </li>
  <li>
   <dl>
    <dt>付款方式</dt>
    <dd><a href="article_read.html">保障范围</a></dd>
    <dd><a href="article_read.html">退换货流程</a></dd>
    <dd><a href="article_read.html">服务中心</a></dd>
    <dd><a href="article_read.html">更多服务特色</a></dd>
   </dl>
  </li>
  <li>
   <dl>
    <dt>服务保障</dt>
    <dd><a href="article_read.html">保障范围</a></dd>
    <dd><a href="article_read.html">退换货流程</a></dd>
    <dd><a href="article_read.html">服务中心</a></dd>
    <dd><a href="article_read.html">更多服务特色</a></dd>
   </dl>
  </li>
 </ul>
 <dl class="wrap otherLink">
  <dt>友情链接</dt>
  <dd><a href="http://www.htmlsucai.com" target="_blank">17素材</a></dd>
  <dd><a href="http://www.htmlsucai.com/pins/24448.html">HTML5模块化后台管理模板</a></dd>
  <dd><a href="http://www.htmlsucai.com/pins/15966.html">绿色清爽后台管理系统模板</a></dd>
  <dd><a href="http://www.htmlsucai.com/pins/14931.html">黑色的cms商城网站后台管理模板</a></dd>
  <dd><a href="http://www.deathghost.cn" target="_blank">前端博客</a></dd>
  <dd><a href="http://www.deathghost.cn" target="_blank">博客</a></dd>
  <dd><a href="http://www.deathghost.cn" target="_blank">新码笔记</a></dd>
  <dd><a href="http://www.deathghost.cn" target="_blank">DethGhost</a></dd>
  <dd><a href="#">当当</a></dd>
  <dd><a href="#">优酷</a></dd>
  <dd><a href="#">土豆</a></dd>
  <dd><a href="#">新浪</a></dd>
  <dd><a href="#">钉钉</a></dd>
  <dd><a href="#">支付宝</a></dd>
 </dl>
 <div class="wrap btmInfor">
  <p>(c) 2013 DeathGhost.cn 版权所有 网络文化经营许可证：浙网文[2013]***-027号 增值电信业务经营许可证：浙B2-200***24-1 信息网络传播视听节目许可证：1109***4号</p>
  <address>联系地址：陕西省西安市雁塔区XXX号</address>
 </div>
</footer>
</div>
<script src="./js/jquery.js"></script>
<script src="js/vue.js"></script>
<script src="js/axios.min.js"></script>
<script type="text/javascript" src="js/show-dialog.js"></script>
<script type="text/javascript" src="js/qs.js"></script>
<script type="text/javascript" src="js/jquery-3.4.1.min.js"></script>
  <script>
  	let app = new Vue({
  		el:'#app',
  		data:{
			shop:{},
			product:{},
			page:1,
			rows:5,
			totalPage:10
  		},
  		methods:{
  			gotoPageNum: function(value){
  				$(".paging .active").attr("id","");
  				$(".paging a").eq(value).attr("id","color");
				axios.post("/product/product/productList",qs.stringify({sid:this.shop.sid,page:value,rows:5})).then(rt =>{
					if(rt.data.code == 200 ){  //发送成功  SUCCESS
						this.product = rt.data.data;
					}
					if(rt.data.code == 500){ //错误  ERROR
						showmsg("错误.....","red", function(){});
						return;
					}
				})
  			}
  		},
  		created(){
  			let sid = 0;
			axios.post("/user/member/checklogin",null).then(rt=>{
				if(rt.data.code == 200){
					this.userinfo = rt.data.data;
					return;
				}
				if(rt.data.code == 511){
					showmsg(rt.data.message + ".....","yellow",function(){location.href="/user/login.html?/product/seller_product_list.html";})
				}
			})	
			
  		},
  		mounted(){
			axios.post("/user/shop/check",null).then(rt=>{
				if(rt.data.code == 200){ 
					this.shop = rt.data.data;
					console.log(this.shop,"shop",this.shop.sid);
					axios.post("/product/product/productList",qs.stringify({sid:this.shop.sid,page:1,rows:5})).then(rt =>{
						if(rt.data.code == 200 ){  //发送成功  SUCCESS
							this.product = rt.data.data;
						}
						if(rt.data.code == 500){ //错误  ERROR
							showmsg("错误.....","red", function(){});
							return;
						}
					})
					
					axios.post("/product/product/producttotal",qs.stringify({sid:this.shop.sid})).then(rt =>{
						if(rt.data.code == 500){ //错误  ERROR
							showmsg("错误.....","red", function(){});
							return;
						}
						
						if(rt.data.code == 200 ){  //发送成功  SUCCESS
							console.log(rt.data.data,"totalpage",rt.data.data / 5);
							this.totalPage = Math.trunc(rt.data.data / 5 );
						}
					})
					return;
				}
			})
  		}
  	});
  	
  	function opentext(){
  		showmsg("不支持自己修改,请申请管理员......","yellow");
  	}
  	</script>
</body>
</html>
